<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
      th:data-authenticated="${isAuthenticated}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>应用中心 - AI Hub 社区</title>
    <link rel="stylesheet" th:href="@{/css/style.css}">
    <style>
        /* 应用中心整体样式 */
        .app-center-container {
            display: flex;
            min-height: calc(100vh - 60px);
        }

        /* 侧边栏样式 */
        .sidebar {
            width: 200px;
            background-color: #f5f7fa;
            padding: 20px;
            border-right: 1px solid #e1e5e9;
        }

        .sidebar h3 {
            font-size: 16px;
            color: #333;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid #e1e5e9;
        }

        .sidebar-nav {
            list-style: none;
        }

        .sidebar-nav li {
            margin-bottom: 10px;
        }

        .sidebar-nav a {
            display: block;
            padding: 8px 12px;
            color: #666;
            text-decoration: none;
            border-radius: 4px;
            transition: all 0.3s;
        }

        .sidebar-nav a:hover {
            background-color: #e1e5e9;
            color: #4CAF50;
        }

        .sidebar-nav a.active {
            background-color: #4CAF50;
            color: white;
        }

        /* 主内容区域样式 */
        .main-content {
            flex: 1;
            padding: 20px;
        }

        /* 搜索和标签页样式 */
        .app-center-header {
            margin-bottom: 20px;
        }

        .app-center-header h2 {
            font-size: 24px;
            color: #333;
            margin-bottom: 15px;
        }

        .search-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .search-box {
            position: relative;
            flex: 1;
            max-width: 400px;
        }

        .search-box input {
            width: 100%;
            padding: 10px 15px 10px 40px;
            border: 1px solid #e1e5e9;
            border-radius: 20px;
            font-size: 14px;
        }

        .search-box i {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
        }

        .category-filter {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 20px;
        }

        .category-tag {
            padding: 6px 16px;
            border: 1px solid #e1e5e9;
            border-radius: 20px;
            font-size: 14px;
            color: #666;
            cursor: pointer;
            transition: all 0.3s;
        }

        .category-tag:hover {
            border-color: #4CAF50;
            color: #4CAF50;
        }

        .category-tag.active {
            background-color: #4CAF50;
            color: white;
            border-color: #4CAF50;
        }

        /* 应用卡片网格样式 */
        .app-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
        }

        /* 应用卡片样式 */
        .app-card {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            transition: all 0.3s;
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .app-card:hover {
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
            transform: translateY(-2px);
        }

        /* 应用卡片内部样式 */
        .app-header {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }

        /* 其他应用卡片内部样式保持不变 */
        .app-icon {
            width: 60px;
            height: 60px;
            border-radius: 12px;
            background-color: #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: #4CAF50;
            margin-right: 15px;
            flex-shrink: 0;
        }

        .app-info {
            flex: 1;
        }

        .app-title {
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin-bottom: 5px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .app-description {
            font-size: 14px;
            color: #666;
            line-height: 1.5;
            margin-bottom: 15px;
            flex-grow: 1;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .app-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            font-size: 12px;
            color: #999;
        }

        .app-author {
            font-size: 12px;
            color: #999;
        }

        .app-stats {
            display: flex;
            gap: 15px;
        }

        .stat-item {
            display: flex;
            align-items: center;
        }

        .stat-item i {
            margin-right: 4px;
        }

        .app-actions {
            display: flex;
            gap: 10px;
        }

        .btn {
            flex: 1;
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
            text-decoration: none;
        }

        .btn-primary {
            background-color: #4CAF50;
            color: white;
        }

        .btn-primary:hover {
            background-color: #45a049;
        }

        .btn-secondary {
            background-color: #f5f7fa;
            color: #666;
            border: 1px solid #e1e5e9;
        }

        .btn-secondary:hover {
            background-color: #e1e5e9;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .app-center-container {
                flex-direction: column;
            }

            .sidebar {
                width: 100%;
                border-right: none;
                border-bottom: 1px solid #e1e5e9;
            }

            .app-grid {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
<header>
    <div class="header-container">
        <h1>AI Hub 社区</h1>
        <nav>
            <ul>
                <li><a th:href="@{/}">首页</a></li>
                <li><a th:href="@{/posts}">帖子</a></li>
                <li><a th:href="@{/users}">用户</a></li>
                <li><a th:href="@{/ai-tools}" class="active">AI应用</a></li>
                <!-- 已登录状态显示个人资料链接 -->
                <li th:if="${isAuthenticated}"><a th:href="@{/profile}">个人资料</a></li>
                <!-- 未登录状态显示登录/注册 -->
                <li th:if="${!isAuthenticated}"><a th:href="@{/login}">登录</a></li>
                <li th:if="${!isAuthenticated}"><a th:href="@{/register}">注册</a></li>
                <!-- 已登录状态显示欢迎信息和退出 -->
                <li th:if="${isAuthenticated}" class="welcome-message">
                    欢迎：<span th:text="${username}"></span>
                    <a th:href="@{/logout}" class="logout-link">退出</a>
                </li>
            </ul>
        </nav>
    </div>
</header>

<main>
    <div class="app-center-container">
        <!-- 侧边栏 -->
        <aside class="sidebar">
            <h3>应用中心</h3>
            <ul class="sidebar-nav">
                <li><a href="#" class="active"><i class="fas fa-th-large"></i> 应用</a></li>
            </ul>
        </aside>

        <!-- 主内容区域 -->
        <div class="main-content">
            <div class="app-center-header">
                <h2>应用中心</h2>

                <!-- 搜索框 -->
                <div class="search-container">
                    <div class="search-box">
                        <i class="fas fa-search"></i>
                        <input type="text" placeholder="搜索应用和功能">
                    </div>
                </div>
                
                <!-- 添加标签页切换 -->
                <div class="tabs">
                    <button class="tab-btn active" data-tab="apps">应用</button>
                    <button class="tab-btn" data-tab="tools">工具</button>
                </div>
                
                <!-- 添加分类筛选 -->
                <div class="category-filter">
                    <button class="category-tag active" data-category="all">全部</button>
                    <button class="category-tag" data-category="featured">精选</button>
                    <button class="category-tag" data-category="ai">人工智能</button>
                </div>
            </div>

            
            <!-- 应用卡片网格（移到app-center-header外部） -->
            <div class="app-grid"></div>
        </div>
        
        <!-- 添加这行来闭合app-center-container -->
    </div>
</main>

<footer>
    <p>&copy; 2025 AI Hub 社区. 保留所有权利.</p>
</footer>

<script th:src="@{/js/main.js}"></script>
<script th:src="@{/js/ai-tools.js}"></script>
</body>
</html>




            <!-- 在style标签内添加新的CSS样式 -->
            <style>
                /* 应用中心整体样式 */
                .app-center-container {
                    display: flex;
                    min-height: calc(100vh - 60px);
                }
            
                /* 侧边栏样式 */
                .sidebar {
                    width: 200px;
                    background-color: #f5f7fa;
                    padding: 20px;
                    border-right: 1px solid #e1e5e9;
                }
            
                .sidebar h3 {
                    font-size: 16px;
                    color: #333;
                    margin-bottom: 15px;
                    padding-bottom: 10px;
                    border-bottom: 1px solid #e1e5e9;
                }
            
                .sidebar-nav {
                    list-style: none;
                }
            
                .sidebar-nav li {
                    margin-bottom: 10px;
                }
            
                .sidebar-nav a {
                    display: block;
                    padding: 8px 12px;
                    color: #666;
                    text-decoration: none;
                    border-radius: 4px;
                    transition: all 0.3s;
                }
            
                .sidebar-nav a:hover {
                    background-color: #e1e5e9;
                    color: #4CAF50;
                }
            
                .sidebar-nav a.active {
                    background-color: #4CAF50;
                    color: white;
                }
            
                /* 主内容区域样式 */
                .main-content {
                    flex: 1;
                    padding: 20px;
                }
            
                /* 搜索和标签页样式 */
                .app-center-header {
                    margin-bottom: 20px;
                }
            
                .app-center-header h2 {
                    font-size: 24px;
                    color: #333;
                    margin-bottom: 15px;
                }
            
                .search-container {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    margin-bottom: 20px;
                }
            
                .search-box {
                    position: relative;
                    flex: 1;
                    max-width: 400px;
                }
            
                .search-box input {
                    width: 100%;
                    padding: 10px 15px 10px 40px;
                    border: 1px solid #e1e5e9;
                    border-radius: 20px;
                    font-size: 14px;
                }
            
                .search-box i {
                    position: absolute;
                    left: 15px;
                    top: 50%;
                    transform: translateY(-50%);
                    color: #999;
                }
            
                .category-filter {
                    display: flex;
                    flex-wrap: wrap;
                    gap: 10px;
                    margin-bottom: 20px;
                }
            
                .category-tag {
                    padding: 6px 16px;
                    border: 1px solid #e1e5e9;
                    border-radius: 20px;
                    font-size: 14px;
                    color: #666;
                    cursor: pointer;
                    transition: all 0.3s;
                }
            
                .category-tag:hover {
                    border-color: #4CAF50;
                    color: #4CAF50;
                }
            
                .category-tag.active {
                    background-color: #4CAF50;
                    color: white;
                    border-color: #4CAF50;
                }
            
                /* 应用卡片网格样式 */
                .app-grid {
                    display: grid;
                    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
                    gap: 20px;
                }
            
                /* 应用卡片样式 */
                .app-card {
                    background-color: white;
                    border-radius: 8px;
                    padding: 20px;
                    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
                    transition: all 0.3s;
                    display: flex;
                    flex-direction: column;
                    height: 100%;
                }
            
                .app-card:hover {
                    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
                    transform: translateY(-2px);
                }
            
                /* 应用卡片内部样式 */
                .app-header {
                    display: flex;
                    align-items: center;
                    margin-bottom: 15px;
                }
            
                /* 其他应用卡片内部样式保持不变 */
                .app-icon {
                    width: 60px;
                    height: 60px;
                    border-radius: 12px;
                    background-color: #f0f0f0;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 24px;
                    color: #4CAF50;
                    margin-right: 15px;
                    flex-shrink: 0;
                }
            
                .app-info {
                    flex: 1;
                }
            
                .app-title {
                    font-size: 16px;
                    font-weight: bold;
                    color: #333;
                    margin-bottom: 5px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
            
                .app-description {
                    font-size: 14px;
                    color: #666;
                    line-height: 1.5;
                    margin-bottom: 15px;
                    flex-grow: 1;
                    display: -webkit-box;
                    -webkit-line-clamp: 3;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                }
            
                .app-meta {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    margin-bottom: 15px;
                    font-size: 12px;
                    color: #999;
                }
            
                .app-author {
                    font-size: 12px;
                    color: #999;
                }
            
                .app-stats {
                    display: flex;
                    gap: 15px;
                }
            
                .stat-item {
                    display: flex;
                    align-items: center;
                }
            
                .stat-item i {
                    margin-right: 4px;
                }
            
                .app-actions {
                    display: flex;
                    gap: 10px;
                }
            
                .btn {
                    flex: 1;
                    padding: 8px 16px;
                    border: none;
                    border-radius: 4px;
                    font-size: 14px;
                    cursor: pointer;
                    transition: all 0.3s;
                    text-align: center;
                    text-decoration: none;
                }
            
                .btn-primary {
                    background-color: #4CAF50;
                    color: white;
                }
            
                .btn-primary:hover {
                    background-color: #45a049;
                }
            
                .btn-secondary {
                    background-color: #f5f7fa;
                    color: #666;
                    border: 1px solid #e1e5e9;
                }
            
                .btn-secondary:hover {
                    background-color: #e1e5e9;
                }
            
                /* 响应式设计 */
                @media (max-width: 768px) {
                    .app-center-container {
                        flex-direction: column;
                    }
            
                    .sidebar {
                        width: 100%;
                        border-right: none;
                        border-bottom: 1px solid #e1e5e9;
                    }
            
                    .app-grid {
                        grid-template-columns: 1fr;
                    }
                }
            
                /* 标签页样式 */
                .tabs {
                    display: flex;
                    margin-bottom: 20px;
                    border-bottom: 1px solid #e1e5e9;
                }
            
                .tab-btn {
                    padding: 10px 20px;
                    background: none;
                    border: none;
                    cursor: pointer;
                    font-size: 16px;
                    color: #666;
                    border-bottom: 2px solid transparent;
                    transition: all 0.3s;
                }
            
                .tab-btn:hover {
                    color: #4CAF50;
                }
            
                .tab-btn.active {
                    color: #4CAF50;
                    border-bottom: 2px solid #4CAF50;
                }
            </style>